package com.example.controller;

import com.example.pojo.Commodity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CommodityController {

    @RequestMapping(value = "/product/{id}")
    public Commodity getCommodityById(@PathVariable("id") Integer id) {
        return new Commodity(id,"红米K30",2599.0);
    }

}
